package delta;

import java.io.*;

public class TtReader {
	
	BufferedReader br;
	public TtReader(String file){
		
		try{
			br = new BufferedReader(new FileReader(file));
		
			
		}
		catch(IOException e){
			e.printStackTrace();
		}
	}
	
	public String Read(Boolean entertIs){
		String line;
		
		try {
		
			while((line=br.readLine()) != null){
				   String str=line.trim();
				   str=str.replaceAll("\\s+", " ");
				   if(entertIs){
					   return str;
				   }
				   else if(str.equals("")==false){
					   return str;
				   }
			}	
			
		} catch (IOException e) {
			e.printStackTrace();
		}
		return null;
	}
	
	
	public void close(){
		try {
			if(br!=null)br.close();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}
